import java.util.Arrays;

/**
 * @Author 12629
 * @Date 2022/5/8 8:42
 * @Description：
 */

class WashMachine{
    //1、字段/属性【成员变量】：类的内部  方法的外部
    public String brand; // 品牌
    public String type; // 型号
    public double weight; // 重量
    public double length; // 长
    public double width; // 宽
    public double height; // 高
    public String color; // 颜色

    //2、行为 / 方法【成员方法】
    public void WashClothes(){ // 洗衣服
        int a = 10;//局部变量
        System.out.println("洗衣功能");
    }

    public void dryClothes(){ // 脱水
        System.out.println("脱水功能");
    }

    public void SetTime(){ // 定时
        System.out.println("定时功能");
    }

}

//后面建议大家 一个java文件  一个类
class Dog {
    public String name;
    public int age;
    public String color;
    //boolean flg;

    public void wag() {
        System.out.println(name+" 摇尾巴！");
    }
    public void bark() {
        System.out.println(name+" 旺旺！");
    }

    public void show() {
        System.out.println("姓名："+name+" 颜色："+color+" 年龄："+age);
    }
}

public class Test {


    public static void main(String[] args) {
        //通过new关键字 实例化了一个对象
        Dog dog = new Dog();
       /* System.out.println(dog.name);
        System.out.println(dog.age);
        System.out.println(dog.color);*/
        dog.name = "初一";
        dog.color = "白色";
        dog.age = 2;
        dog.wag();
        dog.bark();
        dog.show();
        /*int a;
        System.out.println(a);*/
        System.out.println("==============");
        Dog dog2 = new Dog();
        dog2.name = "初二";
        dog2.age = 22;
        dog2.color = "白色2";
        dog2.show();

        Dog dog3 = new Dog();

        Dog dog4 = new Dog();
        //通过一个类  可以实例化 多个对象
    }

    public static void main2(String[] args) {
        int[][] array = new int[2][];//不规则数组
        array[0] = new int[3];
        array[1] = new int[5];
        System.out.println(Arrays.deepToString(array));
        //System.out.println(Arrays.toString(Arrays.toString(array)));
    }

    public static void main1(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        int[][] array2 = new int[][]{{1,2,3},{4,5,6}};
        int[][] array3 = new int[2][3];

        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
        System.out.println("==================");
        for (int[] tmp : array) {
            for (int x : tmp) {
                System.out.print(x+" ");
            }
            System.out.println();
        }
        System.out.println();
        System.out.println("==================");
        System.out.println(Arrays.deepToString(array));
    }
}
